<div class="col-sm-12 mt20">
	<!-- 搜索栏 -->
	<div class="panel panel-default">
		<div class="panel-body" ng-keyup="myKeyup($event)">
			<div class="col-sm-12">
				<div class="row">
					<div class="col-lg-2">
						<input type="text" class="form-control" placeholder="产品名称" ng-model="searchform.name">
					</div>
					<div class="col-lg-2">
						<input type="text" class="form-control" placeholder="产品编号" ng-model="searchform.code">
					</div>
					<div class="col-lg-2">
						<ui-select ng-model="searchform.sale_category" theme="bootstrap">
							<ui-select-match placeholder="产品类型">{{$select.selected.name}}</ui-select-match>
							<ui-select-choices repeat="item.code as item in item_sel.sale_category | filter: $select.search">
								<span ng-bind-html="item.name | highlight: $select.search"></span>
							</ui-select-choices>
						</ui-select>
					</div>
					<div class="col-lg-2">
						<ui-select ng-model="searchform.state" theme="bootstrap">
							<ui-select-match placeholder="产品类型">{{$select.selected.name}}</ui-select-match>
							<ui-select-choices repeat="item.value as item in item_sel.state | filter: $select.search">
								<span ng-bind-html="item.name | highlight: $select.search"></span>
							</ui-select-choices>
						</ui-select>
					</div>
					<div class="col-lg-2">
						<button class="btn btn-info search btn-block" ng-click="loadlist(1)">立即搜索</button>
					</div>
					<div class="col-lg-2">
						<button class="btn btn-info search btn-block" ng-click="updateGoods()">创建产品</button>
					</div>
				</div>

			</div>
		</div>
	</div>

	<!-- 景区产品列表 -->
	<div class="panel panel-default">
		<div class="panel-body">
			<table class="table table-condensed table-hover table-bordered">
				<thead>
					<tr>
						<th class="col-md-4 text-center">产品信息</th>
						<th class="col-md-2 text-center">库存信息</th>
						<th class="col-md-1 text-center">产品状态</th>
						<th class="col-md-2 text-center">操作</th>
					</tr>
				</thead>
				<tbody>
					<tr ng-repeat="info in goodslist">
						<td>名称：{{info.name}} &nbsp;&nbsp;&nbsp;&nbsp;
							<span class="label label-warning pull-right" ng-if="info.type == '1'">消费</span>
							<span class="label label-info pull-right" ng-if="info.type == '2'">储值</span>
							<!-- <span class="label bg-info pull-right m-t-xs">{{info.sale_category==1?'雪具':'零食'}}</span><br/> -->
							编号：{{info.code}}
							<br/> 价格：{{info.price}} 元
							<br/> 景区：{{info.view_name}}
						</td>
						<td>
							<div style="margin-left: 27%">
								总库存：{{info.stock == -1 ? '无限' : info.stock}}
								<br/> 已出售：{{info.sell_num}}
								<br/> 剩余库存：{{info.remaining_stock == -1 ? '无限' : info.remaining_stock}}
							</div>
						</td>
						<td class="text-center">
							<br/>{{info.state==1?'已上架':info.state==2?'下架':'未上架'}}</td>
						<td class="text-center">
							<br/>
							<!-- <button type="button" ng-if="info.state!=1" class="btn btn-info btn-xs" ng-click="updateType(info)">票种</button> -->
							<button type="button" ng-if="info.state!=1" class="btn btn-info btn-xs" ng-click="updateGoods(info)">编辑</button>
							<button type="button" ng-if="info.state!=1" class="btn btn-primary btn-xs" ng-click="setGoodsUp(info)">上架</button>
							<button type="button" ng-if="info.state==0" class="btn btn-danger btn-xs" ng-click="deleteGoods($index)">删除</button>
							<button type="button" ng-if="info.state==1" class="btn btn-primary btn-xs" ng-click="setGoodsDown(info)">下架</button>
						</td>
					</tr>
				</tbody>
			</table>

			<div class="text-right">
				<pagination total-items="totalItems" ng-model="currentPage" ng-change="loadlist()" previous-text="上一页" next-text="下一页" first-text="首页"
				 last-text="尾页" max-size="maxSize" boundary-links="true" rotate="false" items-per-page="itemsPerPage" class="m-t-none m-b">
				</pagination>
			</div>

		</div>
	</div>

</div>